Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: multiworld system #2826

Open
wants to merge 39 commits into
base: main
Choose a base branch
from
Open

feat: multiworld system #2826

wants to merge 39 commits into from

Conversation

phacUFPE
Copy link
Contributor

@phacUFPE phacUFPE commented Aug 17, 2024

Description

SOME CONFIGS WILL BE REMOVED FROM config.lua AND WILL BE USED FROM DATABASE, TABLE worlds!

Implementation of the multiword system.

This PR is in DRAFT due to the necessary modifications:

  • Update login protocol bytes
  • Update schema
  • Create schema migrations
  • Update highscores
  • Load which world the running server is
  • Hirelings spawn and save
  • Test everything

Using MyAAC will need the following PR: opentibiabr/myaac#110

Behaviour

Actual

Multiword system isn't enabled and available

Expected

Multiword system be enabled and available

image

Credits and inspired by: opentibiabr/otservbr-global-archived#929

Type of change

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested

  • Test houses
  • Test mailbox
  • Test hirelings
  • Test bank
  • Test highscores
  • Test guilds
  • ...

Test Configuration:

  • Server Version: main (latest)
  • Client: 13.40 (latest)
  • Operating System: Windows 11

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I checked the PR checks reports
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

Copy link
Contributor

github-actions bot commented Aug 17, 2024

Qodana for C/C++

24 new problems were found

Inspection name Severity Problems
misra-cpp2008-5-0-6 🔶 Warning 5
unroll-loops 🔶 Warning 2
misra-cpp2008-5-0-13 🔶 Warning 2
easily-swappable-parameters 🔶 Warning 2
unnecessary-value-param 🔶 Warning 2
misra-cpp2008-0-1-7 🔶 Warning 2
id-dependent-backward-branch 🔶 Warning 2
suspicious-string-compare 🔶 Warning 1
implicit-bool-conversion 🔶 Warning 1
prefer-member-initializer 🔶 Warning 1
misra-cpp2008-6-4-2 🔶 Warning 1
else-after-return 🔶 Warning 1
avoid-do-while 🔶 Warning 1
function-cognitive-complexity 🔶 Warning 1

💡 Qodana analysis was run in the pull request mode: only the changed files were checked

View the detailed Qodana report

To be able to view the detailed Qodana report, you can either:

To get *.log files or any other Qodana artifacts, run the action with upload-result option set to true,
so that the action will upload the files as the job artifacts:

      - name: 'Qodana Scan'
        uses: JetBrains/[email protected]
        with:
          upload-result: true
Contact Qodana team

Contact us at [email protected]

@lBaah

This comment was marked as resolved.

@phacUFPE phacUFPE force-pushed the phacUFPE/multiworld_system branch 2 times, most recently from 08ad270 to 8be898c Compare August 18, 2024 15:35
config.lua.dist Outdated Show resolved Hide resolved
@phacUFPE phacUFPE force-pushed the phacUFPE/multiworld_system branch from b7c6568 to 0e0eb3b Compare August 22, 2024 18:08
@phacUFPE
Copy link
Contributor Author

phacUFPE commented Aug 26, 2024

This pull request is open for testing, please be aware that it may contain a lot of bugs, if you find anything out of order that was not supposed to happen, please report commenting in here.

@phacUFPE phacUFPE marked this pull request as ready for review August 26, 2024 16:24
@elsongabriel elsongabriel force-pushed the phacUFPE/multiworld_system branch from 34f4234 to 11994ab Compare August 30, 2024 17:26
@DaviRJ
Copy link
Contributor

DaviRJ commented Sep 2, 2024

Apparently, the getWorldConfigsById function, which is called in CanaryServer::loadThisWorld, is returning an invalid value, causing errors later on.

canary_server.cpp line 150
Captura de tela 2024-09-02 114726

Error on line 176 becouse world->type is invalid?
Captura de tela 2024-09-02 115029

@elsongabriel
Copy link
Contributor

elsongabriel commented Sep 3, 2024

Apparently, the getWorldConfigsById function, which is called in CanaryServer::loadThisWorld, is returning an invalid value, causing errors later on.

canary_server.cpp line 150 Captura de tela 2024-09-02 114726

Error on line 176 becouse world->type is invalid? Captura de tela 2024-09-02 115029

something in your config.lua could be wrong. by the way, i'll check.

@DaviRJ
Copy link
Contributor

DaviRJ commented Sep 3, 2024

something in your config.lua could be wrong. by the way, i'll check.

I've checked the config.lua I'm using and the config.lua.dist. Aside from some settings like database access, server name, and rate, I added the toggleServerIsRetroPVP configuration as false.

Below is the difference between the two files (on the left is config.lua.dist).

https://www.diffchecker.com/ZgLRqJEy/

@OpenTibiaMX
Copy link

[warning] [ConfigManager::missingConfigWarning]: Missing configuration for identifier: toggleServerIsRetroPVP

@elsongabriel
Copy link
Contributor

elsongabriel commented Sep 6, 2024

[warning] [ConfigManager::missingConfigWarning]: Missing configuration for identifier: toggleServerIsRetroPVP

now we use the server type from database.

@elsongabriel elsongabriel marked this pull request as draft September 6, 2024 12:10
@DaviRJ
Copy link
Contributor

DaviRJ commented Sep 6, 2024

something in your config.lua could be wrong. by the way, i'll check.

I've checked the config.lua I'm using and the config.lua.dist. Aside from some settings like database access, server name, and rate, I added the toggleServerIsRetroPVP configuration as false.

Below is the difference between the two files (on the left is config.lua.dist).

https://www.diffchecker.com/ZgLRqJEy/

From what I've seen while debugging, the function getWorldConfigsById is always receiving an empty ID (or is ignoring the received parameter???).

image

In this test I've performed, "Received ID: " is always printed, even though the variable worldId is set correctly.

Could it be a type mismatch?

@elsongabriel
Copy link
Contributor

elsongabriel commented Sep 6, 2024

something in your config.lua could be wrong. by the way, i'll check.

I've checked the config.lua I'm using and the config.lua.dist. Aside from some settings like database access, server name, and rate, I added the toggleServerIsRetroPVP configuration as false.
Below is the difference between the two files (on the left is config.lua.dist).
https://www.diffchecker.com/ZgLRqJEy/

From what I've seen while debugging, the function getWorldConfigsById is always receiving an empty ID (or is ignoring the received parameter???).

image

In this test I've performed, "Received ID: " is always printed, even though the variable worldId is set correctly.

Could it be a type mismatch?

do you have table worlds updated with recent changes? and your config.lua has worldId with the same in table worlds?

@DaviRJ
Copy link
Contributor

DaviRJ commented Sep 20, 2024

do you have table worlds updated with recent changes? and your config.lua has worldId with the same in table worlds?

After the last update, this isn't occurring anymore.

I've been running this version for a couple of days. Everything seems fine. I've tested guilds, market, war, character creation, etc. I believe I now need to test Myacc a bit more, but regarding Canary, I haven't found any problems.

@phacUFPE phacUFPE marked this pull request as ready for review September 24, 2024 19:29
Copy link
Contributor

github-actions bot commented Sep 24, 2024

Qodana for C/C++

1040 new problems were found

Inspection name Severity Problems
misra-cpp2008-5-0-11 🔶 Warning 893
err33-c 🔶 Warning 37
static-accessed-through-instance 🔶 Warning 18
misra-cpp2008-5-0-5 🔶 Warning 13
misra-cpp2008-0-1-7 🔶 Warning 5
misra-cpp2008-5-2-12 🔶 Warning 5
function-cognitive-complexity 🔶 Warning 5
misra-cpp2008-4-5-2 🔶 Warning 5
magic-numbers 🔶 Warning 5
misra-cpp2008-5-0-13 🔶 Warning 4
implicit-bool-conversion 🔶 Warning 4
misra-cpp2008-5-0-6 🔶 Warning 4
narrowing-conversions 🔶 Warning 3
unnecessary-value-param 🔶 Warning 3
misra-cpp2008-5-3-1 🔶 Warning 3
unroll-loops 🔶 Warning 3
use-starts-ends-with 🔶 Warning 3
id-dependent-backward-branch 🔶 Warning 3
unnecessary-copy-initialization 🔶 Warning 2
for-range-copy 🔶 Warning 2
easily-swappable-parameters 🔶 Warning 2
misra-cpp2008-6-4-2 🔶 Warning 2
else-after-return 🔶 Warning 2
duplicate-include 🔶 Warning 2
simplify-boolean-expr 🔶 Warning 2
misra-cpp2008-6-4-5 🔶 Warning 1
no-automatic-move 🔶 Warning 1
too-small-loop-variable 🔶 Warning 1
suspicious-string-compare 🔶 Warning 1
prefer-member-initializer 🔶 Warning 1
convert-member-functions-to-static 🔶 Warning 1
avoid-do-while 🔶 Warning 1
pass-by-value 🔶 Warning 1
inconsistent-declaration-parameter-name 🔶 Warning 1
redundant-casting 🔶 Warning 1

💡 Qodana analysis was run in the pull request mode: only the changed files were checked

View the detailed Qodana report

To be able to view the detailed Qodana report, you can either:

To get *.log files or any other Qodana artifacts, run the action with upload-result option set to true,
so that the action will upload the files as the job artifacts:

      - name: 'Qodana Scan'
        uses: JetBrains/[email protected]
        with:
          upload-result: true
Contact Qodana team

Contact us at [email protected]

Copy link
Contributor

This PR is stale because it has been open 45 days with no activity.

@github-actions github-actions bot added the Stale No activity label Oct 26, 2024
@murilo09 murilo09 removed the Stale No activity label Oct 30, 2024
Copy link
Contributor

This PR is stale because it has been open 45 days with no activity.

@github-actions github-actions bot added the Stale No activity label Nov 30, 2024
@elsongabriel elsongabriel removed the Stale No activity label Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants